The present invention relates generally to the management of active objects in distributed object based client/server computing systems. More specifically, the present invention teaches methods and apparatus for managing the activation, deactivation and deletion of objects and processes within a distributed object operating environment that utilizes a reaper to periodically check the status of the managed objects.
In the computer industry, there have been increasing efforts in recent years to provide distributed, object oriented operating environments which permit computers interconnected via a computer network to work together more efficiently. As used herein, the term xe2x80x9cdistributed objectxe2x80x9d or xe2x80x9cobjectxe2x80x9d refers to an encapsulated package of code and data that can be manipulated by operations through an interface. Thus, distributed objects will be seen by those skilled in the art of object oriented programming (OOP) as including the basic properties that define traditional programming objects. However, distributed objects differ from traditional programming objects by the inclusion of two important features. First, distributed objects are multilingual. That is, the interfaces of distributed objects are defined using an interface definition language (DL) that can be mapped to a variety of different programming languages. One such interface definition language is Object Management Group""s IDL. Second, distributed objects are location-independent, i.e., distributed objects can be located anywhere in a network. This contrasts sharply with traditional programing objects which typically exist in a single address space.
Distributed objects can be object clients or object servers, depending upon whether they are sending requests to other objects or replying to requests from clients. In a distributed object operating environment, requests and replies are made through an Object Request Broker (ORB) that is aware of the locations and status of the objects. One architecture which is suitable for implementing such an ORB is provided by the Common Object Request Broker Architecture (CORBA) specification which is incorporated herein by reference. The CORBA specification was developed by the Object Management Group (OMG) to define the distributed computing environment world in terms of objects in a distributed client-server environment, where server objects are capable of providing services to clients requesting the service. In the following discussion, the terms xe2x80x9cobjectxe2x80x9d and xe2x80x9cdistributed objectxe2x80x9d will be used interchangeably.
In any multi-purpose computer system, there is a limited amount of transient memory resources that may be allocated to the resources (e.g. objects and process(es)) that are active within the system. Therefore, there must be some mechanism through which such resources can be deactivated and/or deleted thereby freeing portions of the transient memory for use by other resources. In most personal computer systems, this is done by the user who simply manually deletes or deactivates resources that are not in use. However, such an approach is unsuited for distributed object based computing systems, since objects and processes may be initiated in response to calls received from remotely located clients. In larger systems, servers often run continuously as daemon processes that are started by the operating system during system initialization. As will be appreciated by those skilled in the art, the problem is amplified in distributed object based computing systems since objects and processes may be initiated in response to calls received from remotely located clients. Therefore, reasoned management of the active objects becomes a necessity.
To achieve the foregoing and other objectives and in accordance with the purpose of the present invention, methods and apparatus for managing objects and processes within a distributed object operating environment are taught. According to one embodiment of the present invention a computer system capable of executing a process includes a central processing unit, memory that is allocated to the process, an active object list resident in the memory, an object timeout variable arranged to store a designated object inactivity period, an object timer variable associated with the selected object and a deactivator for deactivating the selected object. The computer system elements have the following attributes. The active object list is arranged to identify objects that are active in the process. The designated object inactivity period value is associated with a selected object and further is indicative of a period of inactivity after which the selected object will be deactivated when the object is in an active state. The object timer variable is arranged to store a value that is suitable for use in determining whether the period of inactivity after which the selected object will be deactivated has been exceeded. The deactivator is arranged to perform the deactivation function when it is determined that the period of inactivity after which the selected object will be deactivated has been exceeded.
In a related embodiment, the computer system is capable of executing a multi-threaded process and the computer system has a mutex associated with the active object list. The active object list mutex serves to synchronize access to the active object list as only the thread in possession of the active object list mutex may access the active object list. In some embodiments of the present invention, the object timeout variable and the object timer variable form a portion of the active object list. In further embodiments, each object entry in the active object list has an associated object timeout variable and an associated object timer variable. In another related embodiment, the computer system further has a deactivation pending list that identifies any objects that are ready to be deactivated. Additionally, the deactivator is arranged to only deactivate objects that are identified in the deactivation pending list.
In yet another related embodiment, the computer system further comprises a deletion flag associated with the selected object. The deletion flag is arranged to indicate whether its associated object is to be deleted.
In a separate embodiment of the invention, a computer system capable of executing a computer process includes a central processing unit, memory that is allocated to the process, a server timeout variable arranged to store a designated inactivity period value that is associated with the process, the designated inactivity period value being indicative of a period of inactivity after which the process will be deactivated, a server timer variable associated with the process and arranged to store a value that is suitable for use in determining whether the period of inactivity after which the server will be deactivated has been exceeded, and a deactivator for deactivating the server when it is determined that the period of inactivity after which the server will be deactivated has been exceeded.
In another embodiment of the present invention, a computer system capable of executing a multi-threaded process is disclosed. According to this embodiment, the computer system comprises a central processing unit, memory that is allocated to the process, an active object list resident in the memory, the active object list being arranged to identify objects that are active in the process, an active object list mutex that permits only one thread to access the active object list at any time, an object timeout variable arranged to store a designated server inactivity period value that is associated with the object, the designated object inactivity period value being indicative of a period of inactivity after which the object will be deactivated, an object timer variable associated with the object and arranged to store a value that is suitable for use in determining whether the period of inactivity after which the object will be deactivated has been exceeded, and a deactivator for deactivating the selected object when it is determined that the period of inactivity after which the selected object will be deactivated has been exceeded.
According to one aspect of the present invention, a computer implemented method of managing objects used in a process executing on a computer system is taught. Each managed object occupies memory allocated to the process and has an associated designated object inactivity period. The computer implemented method comprises the computer implemented steps of, for each managed object, periodically checking to determine whether the managed object has not been accessed within a period that exceeds the associated designated object inactivity period and deactivating managed objects that are determined to have not been accessed within a period that exceeds their designated inactivity period.
A related method aspect includes the computer implemented steps of periodically checking to determined whether the process has not been accessed within a period that exceeds a designated server inactivity period that is associated with the process, and deactivating the process when it is determined that the process has not been accessed within a period that exceeds the designated process inactivity period. In some embodiments, each managed object has an associated timeout variable arranged to store a value indicative of the associated designated object inactivity period, wherein when the value stored in a selected one of the timeout variables is set to a predetermined value, the associated object will not be deactivated based on inactivity.
In a separate method aspect of the present invention, a computer implemented method of managing objects used in a process executing on a computer system that has an active object list that identifies the managed objects is taught. Herein each managed object has an associated designated object inactivity period and an associated deletion flag having a state that indicates that the associated managed object has been marked for deletion. The method of the present aspect of the invention comprises the computer implemented steps of (a) for each managed object, checking to determine whether the managed object has not been accessed within a period that exceeds the associated designated object inactivity period, (b) designating for deactivation managed objects that are determined to have not been accessed within a period that exceeds their designated inactivity period by identifying the managed objects that are designated for deactivation on a deactivation pending list, (c) checking the status of the deletion flags associated with each of the objects in the deactivation pending list to determine whether their associated managed objects have been marked for deletion and freeing the memory associated with such managed objects, and (d) deactivating the managed objects that are identified in the deactivation pending list and are not marked for deletion. Furthermore, the method includes the step of periodically repeating steps (a)-(d).
In yet another separate method aspect of the present invention, a computer implemented method of managing objects is disclosed. In this aspect of the present invention the managed objects are for use in a process executing on a computer system that has an active object list that identifies the managed objects. Each managed object has an associated timeout variable arranged to store a value indicative of a designated object inactivity period and an associated timer variable arranged to store a value indicative of a time at which an activity checking period associated with which the managed object is initialized. The method comprises the computer implemented steps of (a) determining whether the value stored in the timeout variable associated with a selected object is set to predetermined value, wherein when the value stored in the associated timeout variable is set to a predetermined value, the associated object will not be deactivated based on inactivity, (b) checking the timer variable associated with a selected object to determine whether the associated timer variable is in an uninitialized state, wherein when the associated timer variable is found to be in the uninitialized state, the associated timer variable is initialized, and (c) determining whether the time that has elapsed since the timer variable associated with a selected object exceeds the designated object inactivity period associated with that selected object, wherein when the associated period for inactivity is exceeded, the associated object is designated for deactivation by identifying the selected object on a deactivation pending list. The method further teaches (d) repeating the necessary ones of steps (a)-(c) for each of the managed objects to determine whether any of the managed objects should be deactivated based on inactivity and (e) deactivating the managed objects that are identified in the deactivation pending list. Still further, the method teaches periodically repeating steps (d) and (e) while the process is active on the computer system.